package com.study.zk.service;

import com.study.zk.config.SystemConfigUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: chenhs
 * @date: Created in 6:51 2019/12/9
 **/
@Service
public class PayService {

    @Autowired
    SystemConfigUtil systemConfigUtil;

    public String pay(String type) {
        if ("alipay".equals(type)) {
            System.out.println("调用支付宝接口，当前参数配置如下：" + systemConfigUtil.getProperty("pay.alipay.url"));
            return systemConfigUtil.getProperty("pay.alipay.url");
        }

        if ("weixin".equals(type)) {
            System.out.println("调用微信接口，当前参数配置如下：" + systemConfigUtil.getProperty("pay.weixin.url"));
            return systemConfigUtil.getProperty("pay.weixin.url");
        }

        return "OK";
    }

}
